package touchcard;

import java.io.IOException;

import triprecorder.*;

public class TCService
{
	private static TCService instance = null;
	private TripRecorder tripRecorder = null;

	private TCService(){
		tripRecorder = new TripRecorder();
	}

	public static TCService getTCService(){
		if(instance == null){
			instance = new TCService();
		}
		
		return instance;
	}

	public void touchIn(TouchCard tc)
	{
		tripRecorder.touchIn(tc.getTrip());
	}
	
	public void touchOut(TouchCard tc)
	{
		try{
			tripRecorder.touchOut(tc.getTrip());
		}
		catch(IOException ex){
		}
	}
}